import {
  getResidentAll,
  getResidentArr,
  updataResidentById,
  deleteResidentById,
  deleteResidentMoreById,
  SearchResidentKey,
  addResident,
} from "../../api/resident.js";
import { verifyToken } from "../../utils/TokenCheck.js";

export default function residentRouter(router) {
  // 获取全部居民信息
  router.get("/getResidentAll", verifyToken, getResidentAll);
  // 分页查询居民信息
  router.post("/getResidentPage", verifyToken, getResidentArr);
  // 修改指定id居民信息
  router.post("/updataResidentById", verifyToken, updataResidentById);
  // 删除指定id居民信息
  router.delete("/deleteResidentById/:residentId", verifyToken, deleteResidentById);
  // 批量删除指定id居民信息
  router.post("/deleteResidentMoreById", verifyToken, deleteResidentMoreById);
  // 根据key-value分页查询指定居民信息
  router.post("/SearchResidentKey", verifyToken, SearchResidentKey);
  // 添加居民信息
  router.post("/addResident", verifyToken, addResident);
}
